package com.zzyl.test;

import com.zzyl.nursing.domain.NursingProject;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;

import java.math.BigDecimal;

@SpringBootTest
public class RedisTest2 {

    @Autowired
    private RedisTemplate<Object, Object> redisTemplate;

    @Test
    public void test() {
        NursingProject nursingProject = new NursingProject();
        nursingProject.setId(1L);
        nursingProject.setName("洗头");
        nursingProject.setPrice(new BigDecimal(100));

        redisTemplate.opsForValue().set("nursingProject", nursingProject);
        System.out.println(redisTemplate.opsForValue().get("nursingProject"));
    }
}
